<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //   push

        var arr=[1,2,3,4,5]
        var arrp=arr.push(6,7);
        console.log(arr);
        console.log(arrp);


        // pop

        var arr1=['xiao','da','zhong','dong'];
        var arrp1=arr1.pop('dong');
        console.log(arr1);
        console.log(arrp1);

    //    unshift();

       var arr2=['11','22','33','44'];
       var arrp2=arr2.unshift('00');
       console.log(arrp2);
       console.log(arr2);


    //    shift()

    var arr3=[11,22,33,44];
    var arrp3=arr3.shift(11);
    console.log(arrp3);
    console.log(arr3);

    
//    slice 

var arr4=['11','22','33','44'];
var arrp4=arr4.slice(1,2);
console.log(arr4);
console.log(arrp4);


        // splice
        var arr5=['11','22','33','44'];
        var arrp5=arr5.splice(2,1,'66');
        console.log(arr5);

        

        // concat

        var arr6=['11','22','33','444'];
        var arr61=['qwer'];
        var arrp6=arr6.concat(arr6,arr61);
        console.log(arrp6);


        // join

        var arr7=['33','44','55','66'];
        var arrp7=arr7.join(',');
        console.log(arr7);
        console.log(arrp7);

        // reverse

        var arr8=[1,2,3,4,5];
        var arrp8=arr8.reverse();
        console.log(arrp8);


        // sort

        var arr9=[3,4,5,6,7];
        arr9.sort(function(a,b){
            return b-a;
        })
        console.log(arr9);



        // indexof

        var arr10=['a','b','c','d'];
        var arrp10=arr10.indexOf('b');
        console.log(arrp10);


        // lastindexof

        var arr11=[1,2,3,4,5];
        var arrp11=arr11.lastIndexOf(4);
        console.log(arrp11);


        // every 有一个不满足条件就是false

        var arr12=['1','2','3','4'];
        var arrp12=arr12.every(function(index){
            return index>2
        })
        console.log(arrp12);

        // filter  返回满足条件的

        var arr13=[1,2,3,4,5];
        var arrp13=arr13.filter(function(item){
            return item>2
        })
        console.log(arrp13);

        // find 返回满足条件的第一个值

        var arr14=[7,8,9,6];
        var arrp14=arr14.find(function(item){
            return item>6;
        })
        console.log(arrp14);


        // includes
        var arr15=[3,4,5,6];
        var arrp15=arr15.includes(4);
        console.log(arrp15);



        // some 有一个元素满足条件就是TRUE  后面不执行

        var arr16=[7,8,9];
        var arrp16=arr16.some(function(item){
            return item>5;
        })
        console.log(arrp16);

        // reduce
        var arr17=['aa','bb','cc'];
        var arrp17=arr17.reduce(function(a,b,c,d){
            return a + b;

        })
        console.log(arrp17);
    </script>
</body>
</html>